The present invention relates to a bar code demodulating method of and a bar code demodulating apparatus for demodulating a character from bar code data generated by reading bar codes in which characters are expressed by bar widths.
For quickly grasping sales contents of articles, a POS (Point Of Sales) system is on the verge of spreading in supermarkets and department stores. The POS system incorporates a bar code scanner.
The bar code scanner is a device for reading the bar codes printed on a label or a price tag of an article. The bar codes are formed such that characters such as numerals are expressed by bar widths.
The bar code scanner scans the bar codes with laser beams. The bar code scanner reads bar code data from the light of beams reflected by the bar codes. Then, the bar code scanner measures each bar widths of the bar code data and encodes the bar code data into `1` and `0`.
The bar code scanner demodulates the character from coded items of bar code data by use of a demodulation table. That is, the bar code scanner includes a bar code demodulating apparatus and obtains the characters corresponding to the bar codes thereof.
In the above bar code scanner, standard codes are established as JAN (Japanese Article Number) code symbols. The bar codes have a left block representing an article maker code and a right block indicating an article item code. Right-and-left guard bars are provided at marginal portions of the right and left blocks, and a center bar is formed between the right and left blocks.
Further, the left block consists of an odd parity in which a sum of coded `1` is an odd-number and an even parity in which a sum of coded `1` is an even-number. The right block consists of the even parity. The bar code scanner reads the bar codes sequentially from the left guard bar up to the right guard bar in the right direction.
One character is composed of four elements such as a white element, a black element, a white element and a black element and, at the same time, consists of seven modules.
Hence, the numerals from `0` to `9` are expressed by the seven modules with the aid of the white and black elements. In this case, the white element is encoded into `0`, while the black element is encoded into `1`.
Each of an odd parity O and an even parity E of the left block and the even parity E of the right block is expressed by any one of the numerals from `0` to `9`.
For instance, the even parity E of the numeral `4` is composed of, sequentially from the left end, 2 modules (white element), 3 modules (black element), 1 module (white element) and 1 module (black element). A number of modules of the black elements is `4`, i.e., an even-number.
The even parity E of the numeral `6` is composed of, sequentially from the left end, 4 modules (white element), 1 module (black element), 1 module (white element and 1 module (black element). The number of modules of the black elements is `2`, viz., an even-number.
In this case, the bar code demodulating apparatus obtains a delta distance T1 with respect to the even parity E of the numeral `6` to be demodulated. The delta distance T1 is a distance from the first black module at the right end up to the first white module adjacent thereto. The number of modules of the delta distance T1 is 2.
Next, the bar code demodulating apparatus obtains a delta distance T2 with respect to the even parity E of the numeral `6`. The delta distance T2 is a distance from the first white module up to the second black module adjacent thereto. The number of modules of the delta distance T2 is 2.
The bar code demodulating apparatus demodulates the numeral `6` with reference to a distance demodulation table in which the numerical values of the delta distances T1 and T2 correspond to the numerals to be demodulated.
The even parity E (hereinafter termed E2) of the numeral `2` is composed of 2 modules (white element), 2 modules (black element), 1 module (white element) and 2 modules (black element). Both of the delta distances T1 and T2 are 3.
Further, the even parity E (hereinafter termed E8) of the numeral `8` is composed of 3 modules (white element), 1 module (black element), 2 modules (white element) and 1 module (black element).
Both of the delta distances are 3. The delta distances T1 and T2 of both of the even parity E2 and the even parity E8 have the same value.
For this reason, the bar code demodulating apparatus is incapable of distinguishing the even parity E2 from the even parity E8 even by using the distance demodulation table. Also, the bar code demodulating apparatus is incapable of making distinctions, in addition to the above-mentioned, between an odd parity O2 and an odd parity O8, between an odd parity O1 and an odd parity O7 and between an even parity E1 and an even parity E7.
Accordingly, for distinguishing, e.g., the even parity E2 from the even parity E8, the bar code demodulating apparatus obtains the number of black modules with respect to each parity. The number of modules of each of the black elements B1 and B3 of the even parity E2 is 2. The number of modules of each of the black elements B1 and B3 of the even parity E8 is 1.
Herein, the number of black modules of the even parity E8 is different from the number of black modules of the even parity E2. Namely, the bar code demodulating apparatus makes the distinction between the even parity E2 and the even parity E8 with reference to a bar width demodulation table in which the number of modules of the black elements B1 and B3 correspond to the numerals to be demodulated.
Further, the bar codes become thick or thin on the whole due to an error in printing as the case may be. For example, when an optical system is employed for the bar code scanner, a black bar of the bar code is thickened. In general, the black bar and a white bar adjacent thereto are uniformly thickened or thinned.
Particularly, when the numeral is any one of 1, 2, 7 and 8, and if a distortion is produced in the bar width, an accuracy of reading the bar codes declines. For this reason, the bar code demodulating apparatus calculates a difference between a bar width of the character to be demodulated and a bar width of the demodulated character just before the to-be-demodulated character. The printing error is eliminated by the difference between the bar widths.
Also, the bar code demodulating apparatus calculates the number of modules of the difference between the bar widths and adds the number of modules of the bar width of the already-demodulated character to the number of modules of the above difference. With this processing, an ideal number of modules of the bar width of the character to be demodulated is calculated.
That is, if the numeral is any one of 1, 2, 7 and 8, the bar code demodulating apparatus demodulates the character by correcting, as a first correcting process, the bar code by use of the just-before already-demodulated character.
Based on the correcting method according to the prior art, however, if a print quality of the bar code data worsens to some extent, it happens that the bar code is mistakenly read or can not be read.
As discussed above, if it is known that the print quality of the bar code data is, more or less, poor, a dip switch switches over the first correcting process to a second correcting process. The bar code demodulating apparatus demodulates the character by correcting, as the second correcting process, the bar code by use of a length of the to-be-demodulated character.
The bar code demodulating apparatus, however, corrects the bar code data by effecting one of the two correcting processes. For this reason, if the print quality differs per bar code data, the bar code demodulating apparatus is incapable of correcting all the bar code data.
Accordingly, there has been desired a bar code demodulating apparatus capable of reading the bar code without any misread by automatically switching over the correcting processes, even if the bar codes exhibit a comparatively low print quality.